﻿#include "hzpch.h"
#include "Texture.h"
#include "SourceCode/Renderer/Renderer.h"
#include "SourceCode/Platforms/OpenGL/OpenGLTexture.h"

namespace Hazal
{
	Ref<CTexture2D> CTexture2D::Create(uint32_t unWidth, uint32_t unHeight)
	{
		switch (CRenderer::GetAPI())
		{
		case CRendererAPI::API::None:
		{
			HZ_CORE_ASSERT(false, "RendererAPI::None is not supported!");
			return nullptr;
		}
		case CRendererAPI::API::OpenGL:
		{
			return CreateRef<COpenGLTexture2D>(unWidth, unHeight);
		}
		break;
		default:
			break;
		}


		HZ_CORE_ASSERT(false, "No renderer API is supported!");
		return nullptr;
	}
	Ref<CTexture2D> CTexture2D::Create(const std::string& strFilePath)
	{
		switch (CRenderer::GetAPI())
		{
		case CRendererAPI::API::None:
		{
			HZ_CORE_ASSERT(false, "RendererAPI::None is not supported!");
			return nullptr;
		}
		case CRendererAPI::API::OpenGL:
		{
			return CreateRef<COpenGLTexture2D>(strFilePath);
		}
		break;
		default:
			break;
		}

		HZ_CORE_ASSERT(false, "No renderer API is supported!");
		return nullptr;
	}
}